// import Home from "../pages/Home";
// import Login from "../pages/Login";
// import Register from "../pages/Register";
// import Search from "../pages/Search";
// import Detail from '@/pages/Detail'
// import AddCartSuccess from '@/pages/AddCartSuccess'
// import ShopCart from '@/pages/ShopCart'
// import Trade from '@/pages/Trade'
// import Pay from "@/pages/Pay"
// import PaySuccess from '@/pages/PaySuccess'
// import Center from '@/pages/Center'
const routes =[
  {
      name:'home',
      path: "/home",
    component: ()=> import('@/pages/Home'),
    meta: {
      isHiddenNav: true 
      // 是否显示左侧导航
      }
    },
  {
      name:'login',
      path: "/login",
      component: () => import('@/pages/Login'),
      meta: {
        isHiddenFooter:true
      }
  },
  {
    name: 'addcartsuccess',
    path: '/addCartSuccess',
    component: () => import('@/pages/AddCartSuccess'),
  },
  {
    name: 'shopcart',
    path: '/shopCart',
    component:() => import('@/pages/ShopCart'),
  },
  {
    name: 'detail',
    path: '/detail/:id',
    component: () => import('@/pages/Detail'),
    // 开启props传输接收数据
    props:true
}, 
  {
      name:'register',
      path: "/register",
      component: () => import('@/pages/Register'),
      meta: {
        isHiddenFooter:true
      }
    },
  {
      name:'search',
      path: "/search/:keyword?",
      component:() => import('@/pages/Search'),
  },
  {
    name: 'trade',
    path: '/trade',
    component: () => import('@/pages/Trade'),
  },
  {
    name: 'center',
    path: '/center',
    component:() => import('@/pages/Center'),
  },
  {
    name: 'paysuccess',
    path: '/paysuccess',
    component:() => import('@/pages/PaySuccess'),
  },
  {
    name: 'pay',
    path: '/pay',
    component:() => import('@/pages/Pay'),
    },
    {
      path: "/", //设置默认页面
      redirect:'./home'
    }
  ]
;

export default routes